From 1d9e46419253420868515efe929e2c7f74798fc7 Mon Sep 17 00:00:00 2001 From: Massimo Valentini Date: Sat, 16 Jan 2016 19:33:25 +0100 Subject: [PATCH] base: half-float reference zero initialize lsb --- babl/base/type-half.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/babl/base/type-half.c b/babl/base/type-half.c index ac20ec9..5c0d079 100644 --- a/babl/base/type-half.c +++ b/babl/base/type-half.c @@ -138,6 +138,8 @@ static void halfp2doubles(void *target, void *source, long numel) int32_t xes; int e; + if (next) + *xp = 0; xp += next; // Little Endian adjustment if necessary if( source == NULL || target == NULL ) // Nothing to convert (e.g., imag part of pure real) @@ -175,7 +177,9 @@ static void halfp2doubles(void *target, void *source, long numel) *xp++ = (xs | xe | xm); // Combine sign bit, exponent bits, and mantissa bits } } - *xp++ = 0; // Skip over and zero the remaining 32 bits of the mantissa + xp++; // Skip over and zero the remaining 32 bits of the mantissa + if (!next) + *xp = 0; } } -- 2.30.2